'Copyright (c) 2008, Jonathan Allen

''' <summary>
''' 
''' </summary>
''' <remarks>This Token should be saved for later</remarks>
<Serializable()> _
Public Class AccessToken
	Implements IAccessToken
	Private m_Token As String
	Private m_TokenSecret As String
	Private m_UserId As String

	Public Sub New(ByVal userId As String, ByVal token As String, ByVal tokenSecret As String)
		m_UserId = userId
		m_Token = token
		m_TokenSecret = tokenSecret
	End Sub

	Public ReadOnly Property UserId() As String Implements IAccessToken.UserId
		Get
			Return m_UserId
		End Get
	End Property

	Public Sub New(ByVal rawRequestToken As String)
		Dim parsedData = New ClrExtensions.Net.Rest.QueryParameterCollection(rawRequestToken)
		m_Token = parsedData("oauth_token")
		m_TokenSecret = parsedData("oauth_token_secret")
		m_UserId = parsedData("user_id")
	End Sub

	Public ReadOnly Property TokenSecret() As String Implements IAccessToken.TokenSecret
		Get
			Return m_TokenSecret
		End Get
	End Property

	Public ReadOnly Property Token() As String Implements IAccessToken.Token
		Get
			Return m_Token
		End Get
	End Property

End Class
